package com.chenglu.android.index.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chenglu.android.R;
import com.chenglu.android.common.utils.PxUtils;
import com.chenglu.android.index.bean.NearbyShopBean;

import java.util.List;

/**c
 * @author: lyj
 * @Created: by Copyright 2023/3/13 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 * @Description：首页图片的adapter数据
 */
public class NearbyShopItemAdapter extends BaseQuickAdapter<NearbyShopBean.Data.Records.GoodsVOList, BaseViewHolder> {

    private Context mContext ;
    public NearbyShopItemAdapter(@Nullable Context context, List<NearbyShopBean.Data.Records.GoodsVOList> data) {
        super(R.layout.item_nearby_shop_piclist, data);
        this.mContext = context;

    }



    @Override
    protected void convert(@NonNull BaseViewHolder helper, NearbyShopBean.Data.Records.GoodsVOList item) {


        if(item!=null){
//            LogUtils.e("picadapter中的数据"+item.toString());
            ImageView imageView = helper.getView(R.id.iv_shop_pic);
//            RequestOptions options = new RequestOptions()
//                    .placeholder(R.color.white)
//                    .error(R.color.white)
//                    .transform(new RoundedCorners(PxUtils.dp2px(8)));
            Glide.with(mContext).load(item.getGoodsImg()).into(imageView);
        }
    }
}
